
import {mhServer} from '../../../tools/servers'

/**
 * 资讯
 */
export class InformationService {
    // 分页查询列表
    static findInformations (pageDTO) {
        var httpMethod = 'POST';
        var body = mhServer.getArgs(this.findInformations,arguments,'POST');
        return mhServer.connection(httpMethod, '/mh/information/Information/findInformations', body);
    }


    //根据资讯Id查询资讯
    static findInformation (informationId) {
        var httpMethod = 'GET';
        var body = mhServer.getArgs(this.findInformation ,arguments,'GET');
        return mhServer.connection(httpMethod, '/mh/information/Information/findInformation',body);
    }

    //为了编辑,根据资讯Id查询资讯
    static findInformationForEdit(informationId) {
        var httpMethod = 'GET';
        var body = mhServer.getArgs(this.findInformationForEdit ,arguments,'GET');
        return mhServer.connection(httpMethod, '/mh/information/Information/findInformationForEdit',body);
    }

    //为了查看,根据资讯Id查询资讯，所有外键字段的名称都已加载
    static findInformationForView(informationId) {
        var httpMethod = 'GET';
        var body = mhServer.getArgs(this.findInformationForView ,arguments,'GET');
        return mhServer.connection(httpMethod, '/mh/information/Information/findInformationForView',body);
    }

    //创建新的资讯
    static createInformation() {
        var httpMethod = 'GET';
        var body = mhServer.getArgs(this.createInformation,arguments,'GET');
        return mhServer.connection(httpMethod, '/mh/information/Information/createInformation',body);
    }

    //保存资讯
    static saveInformation(information) {
        var httpMethod = 'POST';
        var body = mhServer.getArgs(this.saveInformation,arguments,'POST');
        return mhServer.connection(httpMethod, '/mh/information/Information/saveInformation', body);
    }

    //编辑资讯
    static updateInformation (information) {
        var httpMethod = 'POST';
        var body = mhServer.getArgs(this.updateInformation,arguments,'POST');
        return mhServer.connection(httpMethod, '/mh/information/Information/updateInformation', body);
    }

    //根据资讯Id删除资讯
    static deleteInformation (informationId) {
        var httpMethod = 'GET';
        var body = mhServer.getArgs(this.deleteInformation,arguments,'GET');
        return mhServer.connection(httpMethod, '/mh/information/Information/deleteInformation',body);
    }

    //为了查看,根据资讯Id查询资讯，只加载ID 和 名称
    static findInformationsWithIdNameById(informationId) {
        var httpMethod = 'GET';
        var body = mhServer.getArgs(this.findInformationsWithIdNameById ,arguments,'GET');
        return mhServer.connection(httpMethod, '/mh/information/Information/findInformationsWithIdNameById',body);
    }

    //为了查看,根据资讯 名称 查询资讯，只加载ID 和 名称
    static findInformationsWithIdNameByName(informationName) {
        var httpMethod = 'GET';
        var body = mhServer.getArgs(this.findInformationsWithIdNameByName ,arguments,'GET');
        return mhServer.connection(httpMethod, '/mh/information/Information/findInformationsWithIdNameByName',body);
    }


}
